package com.tanhua.server.service;

import com.tanhua.server.interceptors.UserHolder;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class MovementMqService {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void sendMsgToMq(String movementId,Integer type){
        Long userId = UserHolder.getUserId();
//        谁  对 哪个圈子 做了 什么操作
        Map map = new HashMap();
        map.put("userId",userId);
        map.put("movementId",movementId);
        map.put("type",type);
        rocketMQTemplate.convertAndSend("quanzi_recommend_logs",map);
    }


}
